package com.darwin.darwinBitmapEngine.core
{
	import flash.display.BitmapData;
	import flash.events.IEventDispatcher;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	/**
	 * Node接口。添加到canvas中的对象需要实现INode接口
	 * @author lipi
	 */
	public interface INode extends IEventDispatcher
	{
		
		/** 
		 * 索引ID。生成显示列表全局唯一ID
		 */
		function get g_ID():uint;
			
		function get bitmapData():BitmapData;
		
		function render():void;
		
		function set rect(value:Rectangle):void;
		function get rect():Rectangle;
		
		function set x(value:Number):void;
		function get x():Number;
		
		function set y(value:Number):void;
		function get y():Number;
		
		function set parentContainer(value:IContainer):void;
		function get parentContainer():IContainer;
		
		function set clickEnabled(value:Boolean):void;
		function get clickEnabled():Boolean;
		
		function set mouseHoverEnabled(value:Boolean):void;
		function get mouseHoverEnabled():Boolean;
		
		function set visible(value:Boolean):void;
		function get visible():Boolean;
		
		function set renderNotify(value:Boolean):void;
		function get renderNotify():Boolean;
		
		/**
		 *	执行渲染完成通知 (如果renderNotify为true，则此方法会再本帧渲染完成后被调用)
		 * <br><b>注意:每次标记renderNotify只会导致exeRenderNotify()方法被执行一次，执行完成后renderNotify会被设置为false。</b>
		 */
		function exeRenderNotify():void;
		
		/** 
		 * 检测是否碰撞 
		 * @param x 节点x坐标 
		 * @param y 节点y坐标
		 * @param alphaThreshold 透明度检测，小于这个透明值的将被忽略
		 */
		function hitTest(x:Number,y:Number,alphaThreshold:uint = 0x00):Boolean;
		
		/**
		 * 将 point 对象从INode对象的（本地）坐标转换为舞台（全局）坐标。  
		 * @param point
		 * @return 
		 */
		function localToGlobal(point:Point):Point

		
	}
}